package com.huellas.servlet;

import java.io.IOException;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.huellas.negocio.GestionPacientes;

/**
 * Servlet implementation class ActualizarMantenimiento
 */
@WebServlet("/EliminarMantenimient0")
public class EliminarMantenimient0 extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public EliminarMantenimient0() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		int x = Integer.parseInt(request.getParameter("CoPaciente")) ;
		String y = request.getParameter("NoPaciente");
		double z = Double.parseDouble(request.getParameter("Peso"));
		String f = request.getParameter("FeNacimiento");
		String g = request.getParameter("Genero");
		int fl =  Integer.parseInt(request.getParameter("FlgBuscaParejas"));
		int t = Integer.parseInt(request.getParameter("tamano_CoTamano"));
		int e = Integer.parseInt(request.getParameter("esterilizado_CoEsterilizado")) ;
		int s = Integer.parseInt(request.getParameter("TipoSangre_CoTipoSangre"));
		int a = Integer.parseInt(request.getParameter("actividad_CoActividad")) ;
		int r = Integer.parseInt(request.getParameter("raza_CoRaza"));
		int c = Integer.parseInt(request.getParameter("cliente_usuario_CoUsuario")) ;
	
	
		
		
		GestionPacientes pac = new GestionPacientes();
		try {
			
			String Lista = pac.MantenimientoPaciente(x, y, z, f, g, fl, t, e, s, a, r, c,"L");
			
			request.setAttribute("Resultado", Lista);
			RequestDispatcher rd = request.getRequestDispatcher("MantenimientoPaciente.jsp");
			rd.forward(request, response);
		
		} catch (Exception p) {
		RequestDispatcher rd = request.getRequestDispatcher("error.jsp");
		rd.forward(request, response);
		}
	}
	

}
